package com.jc.service.api.product;

import com.alibaba.fastjson.JSONObject;
import com.jc.ds.base.service.BaseServiceException;
import com.jc.framework.util.SpringUtils;
import com.jc.framework.web.ResponseResultModel;
import com.jc.service.addPullProduct.AddPullProductService;
import com.jc.service.api.BaseDual;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

@SuppressWarnings("all")
public class add extends BaseDual<Product> {
	AddPullProductService addPullProductService = SpringUtils.getBean(AddPullProductService.class);

	@Override
	public ResponseEntity<?> dual(JSONObject data){
			//转换成对应的实体类 ,
			Product product = getData(data);
			if(product == null) {
				throw new BaseServiceException("缺少业务实体参数");
			}
		addPullProductService.addPullProductMethod(product);
		return new ResponseEntity<>(new ResponseResultModel<>(null), HttpStatus.OK);
	}



}
